﻿@model CustomerRewardPointsModel
@using IT.CMS.Web.Models.Customer;
@{
    Layout = "~/Views/Shared/_Root.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.Account").Text);
}
<div class="page account-page reward-points-page">
    <div class="page-title">
        <h1>@T("Account.RewardPoints")</h1>
    </div>
    <div class="page-body">
        <div class="reward-points-overview">
            <div>@T("RewardPoints.CurrentBalance", Model.RewardPointsBalance, Model.RewardPointsAmount)</div>
            @if (Model.MinimumRewardPointsBalance > 0)
            {
                <div>@T("RewardPoints.MinimumBalance", Model.RewardPointsBalance, Model.RewardPointsAmount)</div>
            }
        </div>
        <div class="section-title">
            @T("RewardPoints.History")
        </div>
        <div class="reward-points-history">
            @if (Model.RewardPoints.Count > 0)
            {
                <ul data-role="listview" data-inset="true" data-filter="false" data-theme="c">
                    @foreach (var rph in Model.RewardPoints)
                    {
                        <li>
                            <div class="item">
                                <div>
                                    @T("RewardPoints.Fields.Date"): @rph.CreatedOn
                                </div>
                                <div>
                                    @T("RewardPoints.Fields.Points"): @rph.Points
                                </div>
                                <div>
                                    @T("RewardPoints.Fields.PointsBalance"): @rph.PointsBalance
                                </div>
                                <div>
                                    @T("RewardPoints.Fields.Message"): @rph.Message
                                </div>
                            </div>
                        </li>
                    }
                </ul>
            }
            else
            {
                @T("RewardPoints.NoHistory")
            }
        </div>
    </div>
</div>
